package com.yunang.officialweb.controller;

import com.yunang.officialweb.common.R;
import com.yunang.officialweb.service.*;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author duan
 * @date 2022/11/29 21:34
 */
@RestController
@RequestMapping("/OfficialWebsite")
public class TotalController {
    @Autowired
    private TotalService totalService;

    @Autowired
    private DepService depService;

    @Autowired
    private NumberService numberService;

    @Autowired
    private AUService auService;

    @Autowired
    private FooterService footerService;

    @Autowired
    private ReProService reProService;

    /**
     * joinUs页面的查找
     * @return
     */
    @ApiOperation("查询JoinUs页面的信息")
    @RequestMapping(value = "/getPageOfJoinUs", method = RequestMethod.GET)
    public R getPageOfJoinUs(){
        return R.ok(depService.selectPage());
    }

    /**
     * home页面的查找
     * @return
     */
    @ApiOperation("获得Home页面的信息")
    @RequestMapping(value = "/getPageOfHome", method = RequestMethod.GET)
    public R getPageOfHome(){
        return R.ok(numberService.getExcellentNumber());
    }

    /**
     * AboutUs页面的查找
     * @return
     */
    @ApiOperation("获得Home页面的信息")
    @RequestMapping(value = "/getPageOfAboutUs", method = RequestMethod.GET)
    public R getPageOfAboutUs(){
        return R.ok(auService.getPageOfComInt());
    }

    /**
     * AboutUs页面的查找
     * @return
     */
    @ApiOperation("获得Home页面的信息")
    @RequestMapping(value = "/getPageOfFooter", method = RequestMethod.GET)
    public R getPageOfFooter(){
        return R.ok(footerService.selectFooter());
    }

    /**
     * recentProducts页面的查找
     * @return
     */
    @ApiOperation("获得Home页面的信息")
    @RequestMapping(value = "/getPageOfRecPro", method = RequestMethod.GET)
    public R getPageOfRecPro(){
        return R.ok(reProService.getPageOfRecPro());
    }
}
